/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package iddsgui;

import Main.Parameters;
import plugin.SystemInterface;
import system.MessageOUTPUT;

/**
 *
 * @author zem
 */
public class Main implements SystemInterface {

    public void start() {
        //read messages
        readGUImessages();
        //show GUI
        new GUI().main();

    }

    public void input(String message) { //print message to Message tab\
        try {
            //if the number of lines in GUI Console window is more than maximum amount than delete firsd line;
            if (GUI.instance.ConsoleTextArea.getLineCount() > Parameters.GUI_Console_max_lines) {
                GUI.instance.ConsoleTextArea.replaceRange("", 0, GUI.instance.ConsoleTextArea.getLineEndOffset(0));
            }
        } catch (Exception error) {
        }
        GUI.instance.ConsoleTextArea.append(message + "\n");
        GUI.instance.ConsoleTextArea.moveCaretPosition(GUI.instance.ConsoleTextArea.getText().length());
    }

    public void interrupt() {
    }

    public void pause() {
    }

    public void play() {
    }

    private void readGUImessages() {
        if (Parameters.GUI_ButtonInput == null) {
            //GUI reading
            //GUI frame
            Parameters.GUI_MainTitle = new MessageOUTPUT().Message("GUI_MainTitle", null);
            Parameters.GUI_TaskList_number = new MessageOUTPUT().Message("GUI_TaskList_number", null);
            Parameters.GUI_TaskList_name = new MessageOUTPUT().Message("GUI_TaskList_name", null);
            Parameters.GUI_TaskList_starttime = new MessageOUTPUT().Message("GUI_TaskList_starttime", null);
            Parameters.GUI_TaskList_done = new MessageOUTPUT().Message("GUI_TaskList_done", null);
            Parameters.GUI_TaskTabTitle = new MessageOUTPUT().Message("GUI_TaskTabTitle", null);
            Parameters.GUI_ConsoleTabTitle = new MessageOUTPUT().Message("GUI_ConsoleTabTitle", null);
            Parameters.GUI_MenuFile = new MessageOUTPUT().Message("GUI_MenuFile", null);
            Parameters.GUI_MenuFile_Close = new MessageOUTPUT().Message("GUI_MenuFile_Close", null);
            Parameters.GUI_MenuFile_Exit = new MessageOUTPUT().Message("GUI_MenuFile_Exit", null);
            Parameters.GUI_MenuEdit = new MessageOUTPUT().Message("GUI_MenuEdit", null);
            Parameters.GUI_MenuEdit_TaskCreate = new MessageOUTPUT().Message("GUI_MenuEdit_TaskCreate", null);
            Parameters.GUI_MenuEdit_Parameters = new MessageOUTPUT().Message("GUI_MenuEdit_Parameters", null);
            Parameters.GUI_MenuInfo = new MessageOUTPUT().Message("GUI_MenuInfo", null);
            Parameters.GUI_MenuInfo_About = new MessageOUTPUT().Message("GUI_MenuInfo_About", null);
            Parameters.GUI_MenuInfo_Help = new MessageOUTPUT().Message("GUI_MenuInfo_Help", null);
            Parameters.GUI_ButtonInput = new MessageOUTPUT().Message("GUI_ButtonInput", null);
            //ExitAskFrame
            Parameters.GUI_ExitAskFrame_Title = new MessageOUTPUT().Message("GUI_ExitAskFrame_Title", null);
            Parameters.GUI_ExitAskFrame_Message = new MessageOUTPUT().Message("GUI_ExitAskFrame_Message", null);
            Parameters.GUI_ExitAskFrame_NoButton = new MessageOUTPUT().Message("GUI_ExitAskFrame_NoButton", null);
            Parameters.GUI_ExitAskFrame_YesButton = new MessageOUTPUT().Message("GUI_ExitAskFrame_YesButton", null);
            //TaskCreateFrame
            Parameters.GUI_TaskCreateFrame_TaskCheckButton = new MessageOUTPUT().Message("GUI_TaskCreateFrame_TaskCheckButton", null);
            Parameters.GUI_TaskCreateFrame_TaskNameLabel = new MessageOUTPUT().Message("GUI_TaskCreateFrame_TaskNameLabel", null);
            Parameters.GUI_TaskCreateFrame_TaskSaveButton = new MessageOUTPUT().Message("GUI_TaskCreateFrame_TaskSaveButton", null);

            Parameters.GUI_TaskCreateFrame_Title = new MessageOUTPUT().Message("GUI_TaskCreateFrame_Title", null);
            Parameters.GUI_TaskCreateFrame_PluginLabel = new MessageOUTPUT().Message("GUI_TaskCreateFrame_PluginLabel", null);
            Parameters.GUI_TaskCreateFrame_ParameterLabel = new MessageOUTPUT().Message("GUI_TaskCreateFrame_ParameterLabel", null);
            Parameters.GUI_TaskCreateFrame_ParameterValueLabel = new MessageOUTPUT().Message("GUI_TaskCreateFrame_ParameterValueLabel", null);
            Parameters.GUI_TaskCreateFrame_GroupLabel = new MessageOUTPUT().Message("GUI_TaskCreateFrame_GroupLabel", null);
            Parameters.GUI_TaskCreateFrame_AddParameterValueButton = new MessageOUTPUT().Message("GUI_TaskCreateFrame_AddParameterValueButton", null);
            Parameters.GUI_TaskCreateFrame_AddGroupButton = new MessageOUTPUT().Message("GUI_TaskCreateFrame_AddGroupButton", null);
            Parameters.GUI_TaskCreateFrame_GroupParameterLabel = new MessageOUTPUT().Message("GUI_TaskCreateFrame_GroupParameterLabel", null);
            Parameters.GUI_TaskCreateFrame_GroupParameterValueLabel = new MessageOUTPUT().Message("GUI_TaskCreateFrame_GroupParameterValueLabel", null);
            Parameters.GUI_TaskCreateFrame_AddGroupParameterButton = new MessageOUTPUT().Message("GUI_TaskCreateFrame_AddGroupParameterButton", null);

            Parameters.GUI_TaskCreateFrame_ChangeSubtaskButton = new MessageOUTPUT().Message("GUI_TaskCreateFrame_ChangeSubtaskButton", null);
            Parameters.GUI_TaskCreateFrame_AddSubtaskButton = new MessageOUTPUT().Message("GUI_TaskCreateFrame_AddSubtaskButton", null);
            Parameters.GUI_TaskCreateFrame_RemoveSubtaskButton = new MessageOUTPUT().Message("GUI_TaskCreateFrame_RemoveSubtaskButton", null);
            Parameters.GUI_TaskCreateFrame_ChangeValueButton = new MessageOUTPUT().Message("GUI_TaskCreateFrame_ChangeValueButton", null);

            Parameters.GUI_TaskCreateFrame_TaskStartUpLabel = new MessageOUTPUT().Message("GUI_TaskCreateFrame_TaskStartUpLabel", null);
            Parameters.GUI_TaskCreateFrame_TaskPriorityLabel = new MessageOUTPUT().Message("GUI_TaskCreateFrame_TaskPriorityLabel", null);
            Parameters.GUI_TaskCreateFrame_SubtaskPriorityLabel = new MessageOUTPUT().Message("GUI_TaskCreateFrame_SubtaskPriorityLabel", null);
            Parameters.GUI_TaskCreateFrame_SubtaskTable = new MessageOUTPUT().Message("GUI_TaskCreateFrame_SubtaskTable", null);
            Parameters.GUI_TaskCreateFrame_SubtaskPriorityTable = new MessageOUTPUT().Message("GUI_TaskCreateFrame_SubtaskPriorityTable", null);
            Parameters.GUI_TaskCreateFrame_PluginsComboBox_ChoosePlugin = new MessageOUTPUT().Message("GUI_TaskCreateFrame_PluginsComboBox_ChoosePlugin",null);
            Parameters.GUI_TaskCreateFrame_ParametersComboBox_ChooseParameter=new MessageOUTPUT().Message("GUI_TaskCreateFrame_ParametersComboBox_ChooseParameter",null);
            Parameters.GUI_TaskCreateFrame_GroupComboBox_ChooseGroup=new MessageOUTPUT().Message("GUI_TaskCreateFrame_GroupComboBox_ChooseGroup",null);
            Parameters.GUI_TaskCreateFrame_GroupParametersComboBox_ChooseParameter=new MessageOUTPUT().Message("GUI_TaskCreateFrame_GroupParametersComboBox_ChooseParameter",null);




            //AboutFrame
            Parameters.GUI_AboutFrame_Title = new MessageOUTPUT().Message("GUI_AboutFrame_Title", null);
            Parameters.GUI_AboutFrame_NameLabel = new MessageOUTPUT().Message("GUI_AboutFrame_NameLabel", null);
            Parameters.GUI_AboutFrame_DescriptionLabel ="<html>"+ new MessageOUTPUT().Message("GUI_AboutFrame_DescriptionLabel", null);
            Parameters.GUI_AboutFrame_VersionLabel = new MessageOUTPUT().Message("GUI_AboutFrame_VersionLabel", null);
            Parameters.GUI_AboutFrame_AuthorLabel = new MessageOUTPUT().Message("GUI_AboutFrame_AuthorLabel", null);
            Parameters.GUI_AboutFrame_HomepageLabel = new MessageOUTPUT().Message("GUI_AboutFrame_HomepageLabel", null);
        }
    }
}
